package com.be.beadmin.project.config;

import io.minio.MinioClient;
import io.minio.errors.InvalidEndpointException;
import io.minio.errors.InvalidPortException;
import lombok.Data;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Author: Mengyang Zhu
 * @Date: 2023/2/15 15:55
 * @Description: MinioConfig
 */
@Data
@Configuration
public class MinioConfig {

    private final static String endpoint = "http://47.103.93.109:9000";

    private final static String accessKey = "admin";

    private final static String secretKey = "5U4VV5=r@X@~29";

    private static MinioClient minioClient;

    @Bean
    public static MinioClient getMinioClient() throws InvalidEndpointException, InvalidPortException {
        MinioClient minioClient = new MinioClient(endpoint, accessKey, secretKey);
        return minioClient;
    }


}



